const state = {
	content: '',
	image: '',
	number: 0,
	status: false

}

const actions = {
	updateDiary({
		commit
	}, info) {
		commit('UPDATE_DIARY', info);
	}
}

const mutations = {
	UPDATE_DIARY(state, info = {}) {
		if (info.content !== undefined) {
			state.content = info.content || '';
		}
		if (info.image !== undefined) {
			state.image = info.image || '';
		}
		if (info.number !== undefined) {
			state.number = info.number || 0;
		}
		if (info.status !== undefined) {
			state.status = info.status || false;
		}
	},
}

const getters = {}

export default {
	namespaced: true,
	state,
	getters,
	actions,
	mutations
}
